
********************************************************************************************************
*THIS DO-FILE REPLICATES TABLES 6 IN:                                                  			   
* PATRICIA FUNK: 							                       	
* "HOW ACCURATE ARE SURVEYED PREFERENCES FOR PUBLIC POLICIES? EVIDENCE FROM
* A UNIQUE INSTITUTIONAL SETUP"                                                                                         
********************************************************************************************************

global data ="[your path]"
global results ="[your path]"

clear all
set more off
set matsize 2000


use "$data\VOX_prepared", clear 


gen narrow_margin = 1 if (yes_official<55 & yes_official>45)

gen margin4060=0
replace margin4060=1 if (yes_official>40 & yes_official<60)

gen smalldiff=1 if yes_parties-yes_official<10 & yes_parties-yes_official>-10 
 

areg DEVSP vote_passed if turnout==1, absorb(id) robust
outreg2 using "$results\tab6.xls", se 
 
areg DEVSVP vote_passed if turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg  DEVFDP vote_passed if turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg  DEVCVP vote_passed if turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg Deviationsbig4  vote_passed if turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg Deviationsbig4  vote_passed if smalldiff==1 & turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg Deviationsbig4  vote_passed if margin4060==1 & turnout==1, absorb(id) robust  
outreg2 using "$results\tab6.xls", se append

areg Deviationsbig4  vote_passed if narrow_margin==1 & turnout==1, absorb(id) robust
outreg2 using "$results\tab6.xls", se append

